using System;

namespace FAS.DataBase
{
    public class DbClassFactory
    {
        public DbClassFactory()
        { }

        public IDbController getDbController()
        {
            switch (Connections.getDbType())
            {
                case "SQL":
                    return (new SqlDbController());
                default:
                    throw (new Exception("Not found SQL Server !"));
            }
        }

        public IDbController getDbController(bool bIsPoolingOn)
        {
            switch (Connections.getDbType())
            {
                case "SQL":
                    return (new SqlDbController(bIsPoolingOn));
                default:
                    throw (new Exception("Not found SQL Server !"));
            }
        }

        public IDbController getDbController(string sCnn)
        {
            switch (Connections.getDbType())
            {
                case "SQL":
                    return (new SqlDbController(sCnn));
                default:
                    throw (new Exception("Not found SQL Server !"));
            }
        }
    }
}
